{% macro bind_menu(allMenu, pid, info, menuIds) %}
   {% if allMenu[pid] is defined %}
    <ol class="dd-list">
    {% for menu in allMenu[pid] %}
        <li class="dd-item" data-id="{{ menu.id }}">
            <div class="dd-handle">
                <i class="{{ menu.style|default('') }}"></i>&nbsp;<strong>{{ menu.name }}</strong>&nbsp;&nbsp;&nbsp;
                {% if menu.url!="" and menu.isAccess==0 %}<a href="{{ path(menu.url) }}" class="dd-nodrag">{{ path(menu.url) }}</a>{% endif %}
                <span class="font-weight-lighter"> {{ menu.descr }}</span>
                {% if info['isLock'] ==0 %}
                    <span class="pull-right dd-nodrag">
                        <input type="checkbox" name="access[]" value="{{ menu.id }}" {% if in_array(menu.id, menuIds) %} checked {% endif %} >
                    </span>
                {% endif %}
            </div>
        {{ _self.bind_menu(allMenu, menu.id, info, menuIds) }}
        </li>
    {% endfor %}
    </ol>
{% endif %}
{% endmacro %}
